package com.dissertation.pojo;

public class Message {

    private boolean err; // false 代表失败 true 代表成功
    private String msg; // 错误信息
    private Object data;

    private Message( boolean err, String msg, Object data ) {
        this.err = err;
        this.msg = msg;
        this.data = data;
    }

    public static Message createErr( String msg ) {

        return new Message( false, msg, null );
    }

    public static Message createSuc( Object o ) {

        return new Message( true, null, o );
    }

    public boolean isErr() {
        return err;
    }

    public String getMsg() {
        return msg;
    }

    public Object getData() {
        return data;
    }
}
